<?php

/**
 * InvestInstallment filter form base class.
 *
 * @package    vmdai
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseInvestInstallmentFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'loan_id'                 => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'loan_is_day'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'loan_term_num'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'user_id'                 => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'periodization'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'loan_start_time'         => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'loan_end_time'           => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'current_start_time'      => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'current_end_time'        => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'current_money'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'current_interest_money'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'current_principal_money' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'status'                  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'created_at'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'loan_id'                 => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'loan_is_day'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'loan_term_num'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'user_id'                 => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'periodization'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'loan_start_time'         => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'loan_end_time'           => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'current_start_time'      => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'current_end_time'        => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'current_money'           => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'current_interest_money'  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'current_principal_money' => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'status'                  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'created_at'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('invest_installment_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'InvestInstallment';
  }

  public function getFields()
  {
    return array(
      'id'                      => 'Number',
      'loan_id'                 => 'Number',
      'loan_is_day'             => 'Number',
      'loan_term_num'           => 'Number',
      'user_id'                 => 'Number',
      'periodization'           => 'Number',
      'loan_start_time'         => 'Date',
      'loan_end_time'           => 'Date',
      'current_start_time'      => 'Date',
      'current_end_time'        => 'Date',
      'current_money'           => 'Number',
      'current_interest_money'  => 'Number',
      'current_principal_money' => 'Number',
      'status'                  => 'Number',
      'created_at'              => 'Date',
      'updated_at'              => 'Date',
    );
  }
}
